var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (n, e) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, n) {
              t.__proto__ = n;
            }) ||
          function (t, n) {
            for (var e in n)
              Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]);
          })(n, e);
      };
      return function (n, e) {
        function i() {
          this.constructor = n;
        }
        if ("function" != typeof e && null !== e)
          throw new TypeError(
            "Class extends value " + String(e) + " is not a constructor or null"
          );
        t(n, e),
          (n.prototype =
            null === e
              ? Object.create(e)
              : ((i.prototype = e.prototype), new i()));
      };
    })(),
  NPCDetailDialog = (function (t) {
    function n() {
      var n = t.call(this) || this;
      return (
        (n.npcList = []),
        (n.onLoadNPCDataFn = {
          caller: n,
          code: 713,
          method: function (t) {
            if (0 == t.code) {
              var e = void 0;
              n.npcList = [];
              for (var i = 0; i < t.data.length; i++)
                (e = {
                  label_npcDetail: {
                    text:
                      t.data[i].lvl +
                      "级 " +
                      t.data[i].name +
                      " (" +
                      t.data[i].num +
                      "人）",
                  },
                }),
                  n.npcList.push(e);
              n.list_npcDetail.dataSource = n.npcList;
            } else ToastView.toastView(t.msg);
          },
        }),
        n.btn_npcCancle.on(Laya.Event.CLICK, n, n.onCancleAction),
        (n.list_npcDetail.selectEnable = !0),
        WebSocketService.addListener(n.onLoadNPCDataFn),
        n
      );
    }
    return (
      __extends(n, t),
      (n.showNPCDialog = function (t) {
        null == this.npcDetail &&
          ((this.npcDetail = new n()), (this.npcDetail.zOrder = 1e3)),
          this.npcDetail.popup(!0),
          (this.npcDetail.label_npc_title.text = t.name),
          (this.npcDetail.npc_id = t.id),
          WebSocketService.send({ c: 713, d: { id: t.id } });
      }),
      (n.prototype.onCancleAction = function () {
        this.close();
      }),
      (n.close = function () {
        this.npcDetail && (this.npcDetail.close(), (this.npcDetail = null));
      }),
      n
    );
  })(ui.UserInfoController.NPCDetailDialogUI);
